<template>
  <header>
    <div class="l-content">
      <el-button plain icon="el-icon-menu" size="mini" @click="tabexpand"></el-button>
      <h3 style="color: #fff">首页</h3>
    </div>
    <div class="r-contant">
      <el-dropdown trigger="click" size="mini">
        <span>
          <img class="user" :src="userImg" />
        </span>
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item>个人中心</el-dropdown-item>
          <el-dropdown-item>退出</el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
    </div>
  </header>
</template>
<script>
import bus from '../components/evenBus.js'

export default {
  name: "CommmonHeader",
  data() {
    return {
      userImg: require("../assets/images/user.jpg"),
      isCollapse: false,
    };
  },
  methods: {
      tabexpand(){
          bus.$emit('share',this.isCollapse=!this.isCollapse)
      }
  },
};
</script>
<style scoped>
header {
  display: flex;
  height: 100%;
  justify-content: space-between;
  align-items: center;
}
.l-content {
  display: flex;
  align-items: center;
}
.l-content .el-button {
  margin-right: 20px;
}
.user {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
</style>